package cn.thoughtworks.school.repositories;

import cn.thoughtworks.school.entities.SimpleCodingSubmission;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface SimpleCodingQuizSubmissionRepository extends JpaRepository<SimpleCodingSubmission, Long> {

    List<SimpleCodingSubmission> findByQuizIdInAndAssignmentIdAndUserIdOrderByIdDesc(List<Long> idList, Long assignmentId, Long studentId);

    Optional<SimpleCodingSubmission> findByUserIdAndAssignmentIdAndAndQuizId(Long userId, Long assignmentId, Long quizId);
}
